select A.field0015 as WLDM,C.field0118  as KHBH,A.field0020 as GHJ,A.field0017 as NUM,A.FORMMAIN_ID as CID,C.field0001 as DJBH,to_char(C.field0010,'yyyyMMdd') as BGTIME,to_char(C.field0011,'yyyyMMdd') as ENDTIME,C.field0007 as BT,D.NAME AS USERNAME,E."company"as ADDRESS,T.NAME as DEPTNAME,F.field0009 as VKBUR,Z.field0003 as DQBM,
A.field0015 as "物料代码",C.field0118  as "客户编号",A.field0020 as "供货价",A.field0017 as "数量",C.field0001 as "订单编号",
to_char(C.field0010,'yyyyMMdd') as "开始日期",to_char(C.field0011,'yyyyMMdd') as "结束日期",C.field0007 as "标题",
F.field0009 as "营业部门",Z.field0003 as "营业组织"
from formson_0108 A 
FULL JOIN formson_0113 B ON A.FORMMAIN_ID=B.FORMMAIN_ID
LEFT OUTER JOIN formmain_0107 C ON C.ID=A.FORMMAIN_ID 
LEFT OUTER JOIN ORG_MEMBER D ON D."ID" = C.field0003
LEFT OUTER JOIN "temp_org_member_group" E ON D."ID" = E."member_id"
LEFT outer JOIN ORG_UNIT T ON D.ORG_DEPARTMENT_ID = T."ID"
LEFT OUTER JOIN FORMMAIN_0180 F ON F.FIELD0001=E."company" AND F.field0005=C.FIELD0042
LEFT OUTER JOIN formmain_0182 Z ON Z.field0002=B.FIELD0049 
WHERE A.FORMMAIN_ID=?
order by DQBM DESC